package com.qbw.app.module.mine.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.lib.util.AppUtil;
import com.lib.util.ResUtil;
import com.qbw.app.Constant;
import com.qbw.app.R;
import com.qbw.app.databinding.VehicleActivityAboutBinding;
import com.qbw.app.module.common.activity.CommonActivity;
import com.qbw.app.module.common.activity.WebViewActivity;

/**
 * @author QBW
 * @date 2019-10-20
 */
public class AboutActivity extends CommonActivity<VehicleActivityAboutBinding> {

    public static void start(Context context) {
        Intent intent = new Intent(context, AboutActivity.class);
        if (!(context instanceof Activity)) {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        context.startActivity(intent);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.vehicle_activity_about;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding.title.setListener(this);

        mBinding.tvVersion.setText(ResUtil.getString(R.string.app_name) + " V" + AppUtil.getVersionName(
                this));
        mBinding.tvLink.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                WebViewActivity.start(AboutActivity.this, "", "http://www.wxnuoma.com/", 0, "");

            }
        });
    }
}
